<?php 

class IndexControl{

	public function index(){
		$data = include "./data.php";
		include "./tpl/index.html";
	}

	public function add(){
		$data = include "./data.php";
		$data[] = $_POST;
		$new_data = var_export($data,true);
		$str = <<<jl
<?php 
return {$new_data};
?>
jl;
		file_put_contents("./data.php", $str);

		echo json_encode($_POST);
	}

}


 ?>